home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / mint / mntdoc01.zoo / mintdoc / cat3 / getcwd.3 < prev    next >
Encoding:
Text File  |  1993-03-03  |  1.7 KB  |  67 lines

  1.  
  2.  
  3.  
  4. GETWD(3)            MINTLIB LIBRARY FUNCTIONS            GETWD(3)
  5.  
  6.  
  7. N✓NA✓AM✓ME✓E
  8.        getwd, getcwd - get path-name of current working directory
  9.  
  10. S✓SY✓YN✓NO✓OP✓PS✓SI✓IS✓S
  11.        #include <unistd.h>
  12.  
  13.        char *getwd(char *buf);
  14.  
  15.        char *getcwd(char *buf, int size);
  16.  
  17. D✓DE✓ES✓SC✓CR✓RI✓IP✓PT✓TI✓IO✓ON✓N
  18.        getcwd returns a pointer to  the  current  directory  path
  19.        name.  The value of size is the maximum length of the name
  20.        to be returned. If buf is  a  NULL  pointer,  getcwd  will
  21.        obtain  size  bytes of space using malloc. It is up to the
  22.        calling process to free this buffer.
  23.  
  24.        getwd  is  equivalent  to  getcwd(buf,  PATH_MAX).   Since
  25.        PATH_MAX  is  the length of the longest path name allowed,
  26.        this buffer should always be sufficient. Still, the use of
  27.        this function is discouraged, since it is not specified in
  28.        POSIX and may therefore be unavailable on other systems.
  29.  
  30. S✓SE✓EE✓E A✓AL✓LS✓SO✓O
  31.        c✓ch✓hd✓di✓ir✓r(✓(3✓3)✓),✓, m✓ma✓al✓ll✓lo✓oc✓c(✓(3✓3)✓),✓, D✓Dg✓ge✓et✓tc✓cw✓wd✓d(✓(2✓2)✓),✓, D✓Dg✓ge✓et✓td✓dr✓rv✓v(✓(2✓2)✓),✓, D✓Dg✓ge✓et✓tp✓pa✓at✓th✓h(✓(2✓2)✓)
  32.  
  33. R✓RE✓ET✓TU✓UR✓RN✓N V✓VA✓AL✓LU✓UE✓ES✓S
  34.        These functions return NULL is buf is NULL and  no  memory
  35.        could  be  allocated;  otherwise,  a  pointer  to  buf  is
  36.        returned.
  37.  
  38.  
  39. N✓NO✓OT✓TE✓ES✓S
  40.        On TOS and MiNT before 0.96, the size parameter to  getcwd
  41.        is only used for allocating memory; this functions are not
  42.        yet safe, i.e. buf may overflow.
  43.  
  44.        On UN*X System V.3, the getcwd  function  was  implemented
  45.        using  popen() and the pwd command! There had to be a bet-
  46.        ter way...
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64. MiNT docs 0.1              3 March 1993                         1
  65.  
  66.  
  67.